﻿(function () {

    var goToPetInfoPage = function (invokeEvent) {
        WinJS.Navigation.navigate("/pages/petinfo/petinfo.html", {
            indexInPetsList: invokeEvent.detail.itemIndex
        });
    }

    var goToVetInfoPage = function(invokeEvent) {
        WinJS.Navigation.navigate("/pages/vetinfo/vetinfo.html", {
            indexInVetsList: invokeEvent.detail.itemIndex
        });
    }

    WinJS.Utilities.markSupportedForProcessing(goToPetInfoPage);
    WinJS.Utilities.markSupportedForProcessing(goToVetInfoPage);

    WinJS.Namespace.define("HomeCodeBehind", {
        callLoadPets: function () {
            ViewModels.loadPets();
        },
        callLoadVets: function(){
            ViewModels.loadVets();
        },

        goToPetInfoPage: goToPetInfoPage,
        goToVetInfoPage: goToVetInfoPage
    })
})();